This invention relates to a real-time clock device suitable for a personal computer or the like having an alarm power-on function for automatically turning on the power source at specified time, for example.
Recently, various types of small-sized and high-performance personal computers are developed. In most of the above types of personal computers, for example, the power source switch is not directly operated by the user and an alarm power-on function for automatically turning on the system power source at the power-on time which is previously specified is provided.
By using the alarm power-on function, the system operation can be started at desired time without any attended operator, and therefore, it becomes possible to construct a system operation environment for automatically starting the server at the starting time of work every morning in a case where the personal computer is used as the server of LAN in an office, for example.
The time-base system management is realized by causing a real-time clock provided in the personal computer to generate an alarm interrupt.
The real-time clock (RTC) is a timepiece module having an independent battery for operation and has a backup RAM always supplied with electric power from the battery. The backup RAM is called an RTC memory and used for storing environment setting information which indicates the system operation environment including power-on time, for example.
The setting/changing of the environment setting information is effected on the setup screen provided by the application program executed and controlled by a CPU. One example of the setup screen is shown in FIG. 1.
As shown in FIG. 1, on the setup screen, an environment setting item 60 for starting the alarm power-on function is included.
In the environment setting item 60 of the alarm power-on function, it is possible to specify the enable (use)/disable (non-use) state of the alarm power-on function, and when the alarm power-on function is set in the enable state, it becomes further possible to specify the operation time thereof.
In FIG. 2, the construction of a register in a timepiece information storing area of the backup RAM provided in the real-time clock is shown. The alarm interrupt generating information items (hour, minute, second) set for realizing the alarm power-on function and specified on the setup screen shown in FIG. 1 are stored as alarm information in an hour alarm register, minute alarm register and second alarm register, respectively. Further, specification of the enable/disable state of the alarm power-on function is stored in a control register B. An hour counter register, minute counter register and second counter register for managing the hour, minute and second of a calendar are registers for counting the present time (hour, minute, second).
In the real-time clock with the above construction, an alarm interrupt is generated based on the operational concept shown in FIG. 3. That is, the hour, minute and second indicated by the respective counter registers are compared with hour, minute and second alarm information items stored in the respective alarm registers, and when the result of comparison indicates coincidence and the specification of the enable/disable state of the alarm interrupt stored in the control register indicates the enable state, the alarm interrupt is generated.
However, in the conventional real-time clock, a register for storing the time (year, month, date) of operation of the alarm power-on function is not provided, and therefore, if it is desired to generate an alarm interrupt on the specified time, it is required to effect a process for managing the alarm month and date by a process in a BIOS (basic input and output system) and comparing the alarm month and date thereof with the month and date indicated by the counter registers in the BIOS.
In order to solve the above problem, U.S. Pat. No. 5,422,862 (Inventor: Michael T. Wisor, filed on May 20, 1994) discloses that registers for setting the month and date of the real-time clock are selectively switched by use of a bit of a register to set the month and date of generation of an alarm. That is, as shown in FIG. 4A, when a port address 07h" is specified and an enable bit is "1", month data for timer counter is set in one register (REG1), and when the enable bit is "0", month data for alarm is set in the other register (REG2). Further, as shown in FIG. 4B, when a port address "08h" is specified and the enable bit is "1", date data for timer counter is set in one register (REG3), and when the enable bit is "0", date data for alarm is set in the other register (REG4). As shown in FIG. 4C, when a port address "09h" is specified and the enable bit is "1", year data (lower two digits) for timer counter is set in one register (REG5), and when the enable bit is "0", year data (lower two digits) for alarm is set in the other register (REG6).
However, in this case, since it is necessary to set the switching bit (enable bit) for switching between the normal year, month and date registers and the year, month and date registers for alarm, the process for setting the alarm time based on software becomes complicated and the construction of the comparing circuit becomes complicated because of the switching operation.